package org.lanettiesso.loader;

/**
 * @author lan
 * @date 2020/10/12
 */
public class Webapp {

    private final ClassLoader classLoader;

    private final String home;

    private final Class<?> servletClazz;

    private final String clazz;

    public Webapp(ClassLoader classLoader, String home, String clazz) throws ClassNotFoundException {
        this.classLoader = classLoader;
        this.home = home;
        this.clazz = clazz;
        this.servletClazz = classLoader.loadClass(clazz);
    }

    @Override
    public String toString() {
        return "Webapp{" +
                "classLoader=" + classLoader +
                ", home='" + home + '\'' +
                ", servletClazz=" + servletClazz +
                ", clazz='" + clazz + '\'' +
                '}';
    }

    public ClassLoader getClassLoader() {
        return classLoader;
    }

    public String getHome() {
        return home;
    }

    public Class<?> getServletClazz() {
        return servletClazz;
    }

    public String getClazz() {
        return clazz;
    }
}
